package create.single;

/**
 * @AUTHOR LYF
 * @DATE 2022/3/12
 * @VERSION 1.0
 * @DESC
 * 静态内部类--和饿汉式类似
 */
public class StaticSingleton {
       static class SingletonHolder{
           static final StaticSingleton instance = new StaticSingleton();
       }
       private StaticSingleton(){}
       static final StaticSingleton getInstance(){
           return SingletonHolder.instance;
       }
}
